﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.YG
{
    /// <summary>
    /// 阳光人寿添富年年两全保险分红型
    /// </summary>
    class Class9
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("身故"))
            {
                double a1 = (ppa.GetDutyTotalValue("稳健型账户") + ppa.GetDutyTotalValue("进取型账户")) * 1.05;
                double a2 = ppa.Amount;

                da.Value = a1 > a2 ? a1 : a2;
                ppa.IsCurrentFinish = true;
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Period > 0)
            {
                da.Value = ppa.Amount * 0.1;
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Period > 0 && (ppa.Period+1) % 10==0)
            {
                da.Value = ppa.Amount * 0.18;
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("身故"))
            {
                da.Value = ppa.TotalFee;
                ppa.IsCurrentFinish = true;
            }
        }
    }
}
